home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / mui / bcc_src.lha / Parser / InsertIAttr.cpp < prev    next >
C/C++ Source or Header  |  1998-03-15  |  953b  |  32 lines

  1.  
  2. #include "ParseBC.H"
  3. #include "ClassDef.h"
  4. #include "VarDef.h"
  5.  
  6. void ParseBC::InsertIAttrPre( FILE *fh, unsigned short test )
  7. {
  8.         cont = 0;
  9.         FScan( VarDef, vds, &(cd->Var) ) cont += (vds->switches & test) ? 1 : 0;
  10.         if( cont ) fprintf( fh, " struct TagItem *tags, *tag;\n" );
  11.  
  12. }
  13.  
  14. void ParseBC::InsertIAttr( FILE *fh, unsigned short test )
  15. {
  16.         
  17.         if( cont ) {
  18.         
  19.             fprintf( fh, " for( tags = msg->ops_AttrList; tag = NextTagItem(&tags); ) {\n        switch( tag->ti_Tag ) {\n", cd->Name );
  20.             FScan( VarDef, vd, &(cd->Var) ) {
  21.                 if( (vd->switches & test) && !(switches & SW_VIRTUAL) ) {
  22.                     fprintf( fh, "            case %s:", vd->FullName() );
  23.                     if( vd->switches & SW_SIMPLE ) fprintf( fh, " *((unsigned long*)&data->%s) = tag->ti_Data; break;\n", vd->Name );
  24.                     else fprintf( fh, " a%s%s%s( cl, obj, (void*)tag%s ); break;\n", cd->Name, vd->Name, vd->SGIName( test ), vd->passmsg & test ? ", msg" : "" );
  25.                 }
  26.             }
  27.  
  28.             fprintf( fh, "        }\n    }\n" );
  29.         }
  30.  
  31. }
  32.